﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageBasket.aspx.cs" Inherits="NXBSaiGon.ManageBasket" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:GridView ID="ShoppingCart" runat="server" AllowPaging="True" 
                DataSourceID="ShoppingCartDS" AutoGenerateColumns="False" 
                ShowHeaderWhenEmpty="True" DataKeyNames="ID" CellPadding="4" 
        ForeColor="#333333" GridLines="None" Width="917px" PageSize="5" >
        <AlternatingRowStyle BackColor="White" />
        <Columns>

            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" Width="60" Height="90" style="margin-left:8px;"
                        ImageUrl='<%# Eval("ImgURL", "~/images/book.jpg") %>' />
                </ItemTemplate>
                <HeaderStyle Width="70px" Wrap="False" />
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Product Name">
                <ItemTemplate>
                <h2>   
                    <asp:HyperLink ID="HyperLink1" CssClass="abc" NavigateUrl='<%# "./ChiTiet.aspx?bookid=" + Eval("ID") %>' runat="server" Text='<%# Bind("DisplayName") %>' ></asp:HyperLink>
                    </h2>
                    <p class="cart-item-info">
                    Kích cỡ:
                        <asp:Label  ID="Label3" runat="server" Text='<%# Eval("ChieuCao") + "mm x " + Eval("ChieuRong") + "mm x " + Eval("BeDay") + "mm" %>'></asp:Label>
                    <br />
                    Khối lượng:
                        <asp:Label  ID="Label4" runat="server" Text='<%# Eval("KhoiLuong") + "g" %>'></asp:Label>
                    </p>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Unit Price">
                <ItemTemplate>
                    <center>
                        <asp:Label  ID="Label1" runat="server" Text='<%# Bind("Price") %>'></asp:Label>
                    </center>
                </ItemTemplate>
                <HeaderStyle Width="100px" Wrap="False" />
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Quantity">
                <ItemTemplate>
                    <center>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Quantity") %>' Width="50px" ></asp:TextBox>
                    </center>
                </ItemTemplate>
                <HeaderStyle Width="100px" Wrap="False"/>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Sub Total">
                <ItemTemplate>
                    <center>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Total") %>'></asp:Label>
                    </center>
                </ItemTemplate>
                <HeaderStyle Width="100px" Wrap="False"  />
            </asp:TemplateField>

            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Update">
                        <asp:Image ID="Image3" runat="server" ImageUrl="~/images/check.png" />
                    </asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Width="20px" Wrap="False" />
            </asp:TemplateField>

            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete">
                        <asp:Image ID="Image2" runat="server" ImageUrl="~/images/cross.png"/>
                    </asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle Width="20px" Wrap="False" />
            </asp:TemplateField>

            

        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>



    <asp:ObjectDataSource ID="ShoppingCartDS" runat="server" 
        SelectMethod="getgiohang" TypeName="NXBSaiGon.ManageBasket" 
        DeleteMethod="RemoveCartItem"
        UpdateMethod="UpdateCart">
        
    </asp:ObjectDataSource>
    <hr />
    <a href="./CheckOut.aspx" style=" display:block; background-color:Gray; padding: 5px; text-align: center; color:White; text-decoration:none"><b>Check Out</b></a>
</asp:Content>
